<?php $this->_extends('_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>

<link href="<?php echo $_BASE_DIR; ?>plugins/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>plugins/xheditor/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>plugins/xheditor/xheditor-1.1.11-zh-cn.min.js "></script>
<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>plugins/uploadify/swfobject.js"></script>
<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>plugins/uploadify/jquery.uploadify.v2.1.4.min.js"></script>


<h3>企业信息设置</h3>

    <div class="text">
    <form action="<?php echo url('enterprise/setting'); ?>" method="post" name="form" 
    onsubmit="
    if (this.enterprise_name.value == '') { 
        alert('请输入企业名称'); 
        return false; }
    else { 
        if (this.enterprise_desc.value == '') 
        { 
            alert('请输入企业介绍'); 
            return false; 
        }
        return true; 
    }" enctype="multipart/form-data">
        <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
        <td><span class="defaultbold">企业名称</span><br /></td>
        <td><input class="input" type="text" value="<?php echo $enter->enterprise_name ?>" name="enterprise_name" id="name" size="35" /></td>
        </tr>
        <tr>
        <td>企业Logo</td>
        <td>
    <input id="file_upload" type="file" name="Filedata" /> </p>
    <div id="filesUploaded" name="filesUploaded">
    <?php if($enter->enterprise_logo): ?>
        <img src='<?php echo $enter->enterprise_logo?>' style="max-width:300px;" />
    <?php endif; ?>
    </div>
        <script type="text/javascript">
$(function() {
    $('#file_upload').uploadify({
        'uploader'  : '<?php echo $_BASE_DIR; ?>plugins/uploadify/uploadify.swf',
            'script'    : '<?php echo $_BASE_DIR; ?>plugins/uploadify/uploadify.php',
            'cancelImg' : '<?php echo $_BASE_DIR; ?>plugins/uploadify/cancel.png',
            'folder'    : '<?php echo $_BASE_DIR; ?>upload/enterprise_logo',
            'removeCompleted' : true,
            'fileDesc'  : '图片文件',
            'fileExt'   : '*.jpg;*.bmp;*.png;*.gif',
            'sizeLimit' : 1024 * 1024 * 2,
            'onComplete': function(event, queueID, fileObj, response, data) 
        {
            while(filesUploaded.firstChild)
            {
                var oldNode = filesUploaded.removeChild(filesUploaded.firstChild);
                oldNode = null;
            }
            $('#filesUploaded').append('<img src='+response+' style="max-width:300px;"/><input type=hidden value='+response+' name=uploadpic />');
        }
    }); });
    </script>

    <a href="javascript:$('#file_upload').uploadifyUpload()">上传</a>
        </td>
        </tr>
                <tr>
                <td><span class="defaultbold ">企业介绍</span><br /></td>
                <td><textarea name="enterprise_desc" rows="10" cols="45" ><?php echo $enter->enterprise_desc ?></textarea></td>
        </tr>
        <tr>
                <td class="tbutton" colspan="2"><input type="submit" value="提交" class="btn" name="submit"></td>
        </tr>
        </table>
</form>



<?php $this->_endblock(); ?>
